﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using IP.Core.IPData;
using IP.Core.IPUserService;
using BKIDS.CDBNames;
using IP.Core.IPCommon;
using BKIDS;
using BKIUS;

public partial class DanhMuc_F400_Thanh_vien : System.Web.UI.Page
{
    #region Members
    US_DM_THANH_VIEN m_us_dm_thanh_vien = new US_DM_THANH_VIEN();
    DS_DM_THANH_VIEN m_ds_dm_thanh_vien = new DS_DM_THANH_VIEN();
    #endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            load_data_2_combo_bo_phan();
        }

    }
    // Load dữ liệu lên lưới.
    private void load_data_2_grid()
    {
        m_us_dm_thanh_vien.FillDataset(m_ds_dm_thanh_vien);
        m_grv_thanh_vien.DataSource = m_ds_dm_thanh_vien.DM_THANH_VIEN;
        m_grv_thanh_vien.DataBind();
    }
    protected void m_cmd_xem_toan_bo_Click(object sender, EventArgs e)
    {
        load_data_2_grid();
    }
    protected void m_cmd_loc_du_lieu_Click(object sender, EventArgs e)
    {

    }
    private bool check_trung_user(string ip_str_username)
    {
        m_us_dm_thanh_vien.kiem_tra_ten_dang_nhap_trung(m_ds_dm_thanh_vien, ip_str_username);
        if (m_ds_dm_thanh_vien.DM_THANH_VIEN.Rows.Count > 0) return false;
        return true;
    }
    // Load dữ liệu lên combobox bộ phận (vị trí công việc)
    private void load_data_2_combo_bo_phan()
    {
        US_CM_DM_TU_DIEN v_cm_dm_tu_dien = new US_CM_DM_TU_DIEN();
        DS_CM_DM_TU_DIEN v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();
        //Select * from CM_DM_TU_DIEN WEHERE ID_LOAI_TU_DIEN = 3 và đổ vào trong v_ds_cm_dm_tu_dien
        v_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, "WHERE ID_LOAI_TU_DIEN = " + LOAI_TU_DIEN.VI_TRI_CONG_VIEC);

        m_cbo_bo_phan.DataTextField = CM_DM_TU_DIEN.TEN;
        m_cbo_bo_phan.DataValueField = CM_DM_TU_DIEN.ID;

        m_cbo_bo_phan.DataSource = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
        m_cbo_bo_phan.DataBind();
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("../ChucNang/F410_Cap_nhat_thong_tin_thanh_vien.aspx", false);
    }
}